package com.engine4cloud.tdf.supervision.convert;

import com.engine4cloud.tdf.supervision.dto.result.JzdxCustomFenceResultDTO;
import com.engine4cloud.tdf.supervision.entity.JzdxCustomFenceEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;


@Mapper
public interface JzdxCustomFenceConvert {
    JzdxCustomFenceConvert INSTANCE = Mappers.getMapper(JzdxCustomFenceConvert.class);

    JzdxCustomFenceEntity createCustomTo(String coordinate);

    JzdxCustomFenceResultDTO convert(JzdxCustomFenceEntity s);

    default JzdxCustomFenceEntity createCustom(String coordinate, String code, String batch, Long tenantId) {
        JzdxCustomFenceEntity entity = createCustomTo(coordinate);
        entity.setRybh(code);
        entity.setLcbh(batch);
        entity.setTenantId(tenantId);
        return entity;
    }

}
